package de.vocabulary.client;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.VerticalPanel;

public class Dialog {
	
	public static DialogBox NotYetImplementedDialog(){
		return NotYetImplementedDialog("Not yet implemented");
	}
	
	public static DialogBox NotYetImplementedDialog(String message){
		final DialogBox dialogBox = new DialogBox();
		dialogBox.setText(message);
		
		dialogBox.setAnimationEnabled(true);
	    Button closeButton = new Button("close");
	    VerticalPanel dialogVPanel = new VerticalPanel();
	    dialogVPanel.setWidth("100%");
	    dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
	    dialogVPanel.add(closeButton);

	    closeButton.addClickHandler(new ClickHandler() {
	      @Override
	      public void onClick(ClickEvent event) {
	        dialogBox.hide();
	      }
	    });
	    dialogBox.setWidget(dialogVPanel);
		return dialogBox;
	}

}
